import { _decorator, Component, Node, Prefab,instantiate } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('EnemyManager')
export class EnemyManager extends Component {

    @property(Prefab)
    airplane: Prefab = null;

    start() {
        const { x, y } = this.node.getPosition();
        this.schedule(() => {
            const node = instantiate(this.airplane);
            node.setPosition(Math.random()*400+40, y);
            this.node.addChild(node);
        }, 0.5);


    }

    update(deltaTime: number) {

    }
}


